package com.itheima.c09_innerclass_noname_use;

public class Test {

    public static void swim(ISwimming swim){
        System.out.println("开始计时。。。");
        swim.swim();
        System.out.println("结束计时。。。");
    }
    public static void main(String[] args) {
        //匿名内部类
        //1.创建对象
        //2.重写方法
        //3.使用对象
        ISwimming swim = new ISwimming() {
            @Override
            public void swim() {
                System.out.println("狗游泳");
            }
        };
        //swim(pig);

        }
    }

